package com.lee.controller.system;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

import com.alibaba.dubbo.config.annotation.Reference;
import com.lee.system.api.IMenuService;
import com.lee.system.entity.Menu;
import com.lee.system.entity.User;
import com.lee.utils.ShiroUtils;

/**
 * 首页
 * 
 * @author LiPengFei
 *
 */
@Controller
public class IndexController {
	@Reference
	IMenuService iMenuService;

	@GetMapping("/index")
	public String index(Map<String, Object> map) {
		User user = ShiroUtils.getUser();
		List<Menu> menus = iMenuService.selectMenusByUserId(user.getUserId());
		map.put("menus", menus);
		map.put("user", user);
		return "index";
	}

	// 系统介绍
	@GetMapping("/system/main")
	public String main(Map<String, Object> map) {
		return "main";
	}
}
